<?php
function p($d){
    echo "<pre>";
    print_r($d);
    echo "</pre>";
}

$str="";
if(isset($_POST["source"])){
    $data = $_POST["source"];
    $data = explode(PHP_EOL,$data);
    foreach ($data as $k => $v){
        $v = explode(":",$v);
        $temp = "|".$v[0]."    |   是  |   string |    默认说明|";
        $str .= $temp.PHP_EOL;
    }
}


?>

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>post自动转换markdown语法工具</title>

</head>
<body>
<h1>请输入源数据</h1>
<form action="" method="post">
<textarea class="textarea" name="source" style="width: 100%; height: 300px;" ></textarea>
    <button type="submit">保存</button>
</form>


<h1>转换后数据</h1>
<textarea class="textarea" name="" style="width: 100%; height: 300px;" ><?=$str?></textarea>
</body>
</html>
